package com.msb.sentinelOpenfeign.openfeign;

import com.msb.common.JsonResult;
import com.msb.sentinelOpenfeign.config.RibbonIRuleConfig;
import com.msb.sentinelOpenfeign.openfeign.impl.SentinelOpenFeignServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/****************************************************
 * Sentinel 整合 OpenFeign
 *
 * fallback: 定义容错的处理类，当调用远程接口失败或超时时，
 * 会调用对应接口的容错逻辑，fallback指定的类必须实现@FeignClient标记的接口
 *
 * @author lbf
 * @date 2025/6/27 16:03
 ****************************************************/
@FeignClient(value = "nacos-provider",fallback = SentinelOpenFeignServiceImpl.class)
public interface SentinelOpenFeignService {

    @GetMapping("/info/{id}")
    public JsonResult<String> msbSql(@PathVariable("id") Long id);
}
